import { GroupSelector, RoleSelector, UserGroupSelector, UserSelector } from '@/components/selectors';
import ExcelSelect from '@/components/excelselect';
import {
  Bizpropselector,
  CodeListSelector,
  Fieldselector,
  MetadataSelector,
  Objectselector,
  UnitDomanSelector,
  UnitSelector,
} from '@/components/selectors';
// import FlowTemplateSelector from '@/components/workflow/flowtemplateselector';
import { DatePicker } from 'gantd';
import { Switch, DatePicker as AntDatePicker, Checkbox } from 'antd';
import WrapGantDatePicker from 'gantd/lib/date-picker';
import { setFields } from 'gantd/lib/schema-form';
import { CodeList, FileUpload, ImageUpload } from '../index';
import InputSelector from '../inputselector';
import SelectEdit from '../selectedit';
const { WeekPicker } = AntDatePicker;
const { GantdDatePicker } = WrapGantDatePicker;
export enum Fields {
  ImageUpload = 'ImageUpload',
  FileUpload = 'FileUpload',
  CodeList = 'CodeList',
  UserSelector = 'UserSelector',
  RoleSelector = 'RoleSelector',
  GroupSelector = 'GroupSelector',
  UserGroupSelector = 'UserGroupSelector',
  SelectEdit = 'SelectEdit',
  CodeListSelector = 'CodeListSelector',
  UnitSelector = 'UnitSelector',
  UnitDomanSelector = 'UnitDomanSelector',
  MetadataSelector = 'MetadataSelector',
  Objectselector = 'Objectselector',
  Fieldselector = 'Fieldselector',
  Bizpropselector = 'Bizpropselector',
  WeekPicker = 'WeekPicker',
  // FlowTemplateSelector = 'FlowTemplateSelector',
  InputSelector = 'InputSelector',
  GantdDatePicker = 'GantdDatePicker',
  DatePicker = 'DatePicker',
  ExcelSelect = 'ExcelSelect',
  Switch = 'Switch',
  Checkbox = 'Checkbox',
}

const fields = {
  [Fields.ImageUpload]: ImageUpload,
  [Fields.FileUpload]: FileUpload,
  [Fields.CodeList]: CodeList,
  [Fields.UserSelector]: UserSelector,
  [Fields.RoleSelector]: RoleSelector,
  [Fields.GroupSelector]: GroupSelector,
  [Fields.UserGroupSelector]: UserGroupSelector,
  [Fields.SelectEdit]: SelectEdit,
  [Fields.CodeListSelector]: CodeListSelector,
  [Fields.UnitDomanSelector]: UnitDomanSelector,
  [Fields.UnitSelector]: UnitSelector,
  [Fields.MetadataSelector]: MetadataSelector,
  [Fields.Objectselector]: Objectselector,
  [Fields.Fieldselector]: Fieldselector,
  [Fields.Bizpropselector]: Bizpropselector,
  [Fields.WeekPicker]: WeekPicker,
  // [Fields.FlowTemplateSelector]: FlowTemplateSelector,
  [Fields.InputSelector]: InputSelector,
  [Fields.GantdDatePicker]: GantdDatePicker,
  [Fields.DatePicker]: DatePicker,
  [Fields.ExcelSelect]: ExcelSelect,
  [Fields.Switch]: Switch,
  [Fields.Checkbox]: Checkbox,
};

export const schemaFormInit = () => setFields(fields);
